package org.example.domain.model.entity.url.req;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Schema(description = "短链接创建请求对象")
public class UrlShortenerCreateReq {

    @Schema(description = "域名")
    private String domainName;

    @Schema(description = "原始链接")
    @NotNull(message = "链接不能为空")
    private String originUrl;

    @Schema(description = "分组标识")
    @NotNull(message = "请选择分组!")
    private String gid;

    @Schema(description = "创建类型 0：接口创建 1：控制台创建")
    private Integer createdType;

    @Schema(description = "有效期类型 0：永久有效 1：自定义")
    private Integer validDateType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyy-MM-dd HH:mm:ss")
    @Schema(description = "有效期")
    private Date validDate;

    @Schema(description = "描述")
    private String description;
}
